#include<iostream>
#include<string>
using namespace std;
using ll = long long;
const int N = 110;
ll fm[N], fs[N];
// ll getAim(ll x, ll y)
// {
//     return y == 0 ? x : getAim(y, x % y);
// }

long long gcd(long long a, long long b) {return b == 0 ? a : gcd(b, a % b);}
ll lcm(ll a, ll b)
{
    return (a / gcd(a, b)) * b;  // 强制顺序避免溢出
}
int main()
{
    int n; cin >> n;
    for (int i = 1; i <= n; i++)
    {
        scanf("%lld/%lld", &fs[i], &fm[i]);
    }
    ll rets = fs[1];
    for (int i = 1; i < n; i++)
    {
        // zdl:: 现在要求找到分母的最小公倍数
        ll t = lcm(fm[i], fm[i + 1]);
        ll a = t / fm[i], b = t / fm[i + 1];
        rets = rets * a + fs[i + 1] * b;
        fm[i + 1] = t;
        // zdl:: 分子分母约分
        ll x = gcd(fm[i + 1], rets);
        fm[i + 1] /= x; rets /= x;
    }
    if (rets % fm[n] == 0) 
    {
        cout << rets / fm[n];
    }
    else if (rets < fm[n])
    {
        cout << rets << "/" << fm[n];
    }
    else{
        cout << rets / fm[n] << " ";
        rets -= fm[n] * (rets / fm[n]);
        cout << rets << "/" << fm[n];
    }
    return 0;
}